export const billType = {
    pay: [
        {
            type: 'foods',
            name: '餐饮',
            list: [
                {type: 'food',name: '餐费'},
                {type: 'drinks',name: '酒水饮料'},
                {type: 'dessert',name: '甜品零食'},
            ]
        },
        {
            type: 'taxi',
            name: '出行交通',
            list: [
                {type: 'taxi',name: '打车租车'},
                {type: 'longdistance',name: '旅行票费'},
            ]
        },
        {
            type: 'recreation',
            name: '休闲娱乐',
            list: [
                {type: 'bodybuilding',name: '运动健身'},
                {type: 'game',name: '休闲玩乐'},
                {type: 'audio',name: '媒体影音'},
                {type: 'travel',name: '旅游度假'},
            ]
        },
        {
            type: 'daily',
            name: '日常支出',
            list: [
                {type: 'cloths',name: '衣服裤子'},
                {type: 'bag',name: '鞋帽包包'},
                {type: 'book',name: '知识学习'},
                {type: 'home',name: '家装布置'},
            ]
        },
        {
            type: 'other',
            name: '其他支出',
            list: [
                {type: 'community',name: '社区缴费'},
            ]
        },
    ],
    income: [
        {
            type: 'professional',
            name: '工资收入',
            list:[
                {type: 'salary',name: '工资'},
                {type: 'overtimepay',name: '加班工资'},
                {type: 'bonus',name: '绩效奖金'},
            ]
        },
        {
            type: 'other',
            name: '其他收入',
            list:[
                {type: 'financial',name: '理财收入'},
                {type: 'cashgift',name: '礼金收入'},
            ]
        }
    ]
}

export const billTypeTagName = Object.keys(billType).reduce((prev,key) => {
    billType[key].forEach(bill => {
        bill.list.forEach(item => {
            prev[item.type] = item.name
        })
    });
    return prev
},{}) 